package com.ecloud.service.security.feign.iface;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ecloud.common.base.result.Result;
import com.ecloud.common.base.result.Rows;
import com.ecloud.common.web.config.AutoFeignConfiguration;
import com.ecloud.openapi.translate.dto.BaseDictionaryDto;
import com.ecloud.openapi.translate.vo.BaseDictionaryListVo;
import com.ecloud.service.security.feign.fallback.BaseDictionaryFallbackFactory;

/**
 * 字典API
 *
 * @author LiuGangQiang Create in 2021/08/10
 */
@Component
@FeignClient(contextId = "dictionary", value = "${remote.server.addr.translate}", configuration = AutoFeignConfiguration.class, fallbackFactory = BaseDictionaryFallbackFactory.class)
@RequestMapping({ "/base/dictionary" })
public interface BaseDictionaryFeign {
    /**
     * 查询列表
     *
     * @author LiuGangQiang Create in 2021/08/10
     * @param dto 入参
     * @return {@link Result}
     */
    @GetMapping({ "/list" })
    @Cacheable(value = "dict")
    public Result<Rows<BaseDictionaryListVo>> queryList(@SpringQueryMap BaseDictionaryDto dto);
}
